<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class CourseArrangeLogModel extends Model
{
    use HasFactory;
    protected $table = 'course_arrange_log';
    protected $fillable = [
        'company_id',
        'type',
        'class_id',
        'course_id',
        'teacher_id',
        'room_id',
        'start_date',
        'end_date',
        'dates',
        'time',
        'weeks',
        'course_num'
    ];

    public function course() {
        return $this->belongsTo(CourseModel::class, 'course_id', 'id');
    }

    public function class() {
        return $this->belongsTo(ClassModel::class, 'class_id', 'id');
    }

    public function teacher() {
        return $this->belongsTo(TeacherModel::class, 'teacher_id', 'id');
    }
    public function room() {
        return $this->belongsTo(RoomModel::class, 'room_id', 'id');
    }
}
